home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-23 | 13.4 KB | 306 lines | [TEXT/ttxt] |
- 9 Customising MacDOS
-
- autoexec.bat
- MacDOS launches the batch program named autoexec.bat every
- time it starts. Therefore, autoexec.bat is effectively the
- MacDOS' preference file. In it you can:
- • Set your preferred date format with DATE.
- • Set a 12 or 24 hour clock with TIME.
- • Make your life a bit more dangerous with
- CONFIRM OFF.
- • Make file copies faster with VERIFY OFF.
- • Ensure that you do not overlook any error messages
- by forcing MacDOS to display an alert box whenever an
- error or warning condition occurs. For this purpose use
- the command ALARM ON.
- • Use PATH to tell MacDOS in which folders you keep
- your executable files (applications and batch programs).
- • Set your preferred command prompt with PROMPT.
- • SET the system variable DIRCMD to your preferred
- defaults for listing folders.
- • Assign your literal volume IDs with SUBSTVOL.
- • Use CALL to execute additional initialisation batch
- programs and to launch other Mac applications.
- • Use TYPE to display a text file containing reminders
- of things to do.
- • Store the MacDOS directory name into the global
- variable HOME by SETting it to %WHERE%.
- • Attach to your working folder with CHDIR.
- • ECHO to the screen a welcoming message.
- • Set up your abbreviations by SETting the variable
- ABBREV.
- • Change the size of the characters displayed in the
- console window by SETting the system variable FONTSIZE.
- • Change the character used for quoting long filenames
- by SETting the system variable QUOTE.
- • Change the file creator used for output text files
- by SETting the system variable CREATOR.
- • Decide to be notified of all incoming Apple Events
- by SETting the variable SHOWAE.
-
- Date
- You can change the system date with the command DATE. With
- the same command you can also choose the format for
- entering and displaying dates.
-
- For example, you can choose to use an American format for
- the dates by typing:
- date mm/dd/yy
- If you then change the system date with the command
- date 5/23/94
- MacDOS will display the new date as:
- 05/23/94
-
- Alternatively, you can compose your own date format:
- date yyyy;mmmm,dddd
- If you then change the system date with the command
- date 94;5,23
- MacDOS will display the new date as:
- 1994;0005,0023
-
- Time
- When you change the system time with the command TIME, you
- can at the same time choose between a 12 and a 24 hour
- clock format. You can also choose the separators used
- between the time fields.
-
- For example, if you set the system time with the command
- time 17.20.10
- MacDOS will display times with a 24 hour clock and dots as
- separators.
-
- If you set the system time to midnight, MacDOS interprets
- the command as a request to change the clock format. This
- means that you cannot actually change the system time to
- midnight (you will have to wait at least one second !), but
- gives you the possibility of choosing the clock format
- without altering the current system time.
-
- Therefore,
- time 00:00:00a
- leaves the current time unchanged and switches to a 12 hour
- clock. Similarly,
- time 24:00:00
- switches to a 24 hour clock without touching the system
- time.
-
- Alerts
- By default, MacDOS reports errors and warnings with a line
- of text. If you execute the command ALARM ON , MacDOS
- replaces the line of text with an alert box and waits for
- you to click on its OK button before continuing.
-
- ALARM OFF reverts the error and warning reporting to the
- default.
-
- With ALARM ON , you can execute complex batch programs
- without having to monitor their progress, because you know
- that MacDOS automatically suspends execution if it
- encounters a problem.
-
- Confirmation
- When you use the Finder to move files between folders, the
- Finder always asks for confirmation before overwriting
- existing files. Also when you empty the Trash you have to
- confirm it.
-
- By default, MacDOS does the same and prompts you for
- confirmation. This is particularly important when DELeting
- files, because MacDOS removes them from the system instead
- of copying them to the Trash.
-
- You can direct MacDOS not to ask for confirmation by
- executing CONFIRM OFF .
-
- You can then revert to the safer default with the command
- CONFIRM ON .
-
- It is a good and safe practice to disable confirmations
- only in special cases and for short periods of time. Be
- aware of the fact that if you disable confirmation within a
- batch program, it remains disabled after the batch has
- completed execution. It is therefore advisable to re-enable
- safeguards within the same batch file that disables them.
-
- Verification of File Copying
- By default, MacDOS verifies the correctness of all COPY and
- XCOPY operations. You can disable verification by executing
- VERIFY OFF. You can then revert back to the safer default
- with VERIFY ON .
-
- With VERIFY ON , MacDOS reads the copy and compares it
- with the original. Naturally, this slows down the whole
- operation. Nevertheless, it is advisable to put up with the
- little delay, especially when copying to floppies: only
- when the files are read back correctly you can be sure that
- they were written correctly.
-
- Prompt
- The command PROMPT tells MacDOS how to prompt you for a new
- command. Through PROMPT, you can request MacDOS to display
- special information like the current date and time, the
- specification of the current folder, the current volume ID,
- and the MacDOS version.
-
- PROMPT is in fact a command which is totally equivalent to
- the SETting of the system variable PROMPT. The only
- advantage of using the command instead of a straight SET is
- that the command performs a syntax check on the prompt
- string.
-
- Literal Volume IDs
- Instead of using straight volume reference numbers to
- identify volumes, you can use the command SUBSTVOL to
- define literal IDs. To a large extent, this is just a
- cosmetic change. Nevertheless, it can be of great help if
- you want to port batch programs originally developed for
- DOS.
-
- Abbreviations
- MacDOS supports an abbreviation mechanism that lets you
- type short words to insert long strings into the command
- line.
-
- To use this mechanism, you must:
- • Store your abbreviations into a file.
- • Tell MacDOS how to find the file.
- • Tell MacDOS what abbreviation you want to have expanded.
-
- Preparing an Abbreviation File
- With any text editor or word processor, create a file of
- type 'TEXT' and insert lines like:
- abbr this
- where abbr is the abbreviation and this is the string to be
- abbreviated.
-
- The rules governing the formatting are:
- • abbr must be at the beginning of a line.
- • this is delimited on the left by the first space or tab
- (ie. the first blank) which follows abbr, and on the
- right by a Carriage Return. Therefore, additional spaces
- or tabs between abbr and this will be considered to be
- part of this. Moreover, there can only be one
- abbreviation per line.
- • Only the first 199 characters of each line are
- interpreted. The rest of the line is ignored (ie. the
- string to be abbreviated is truncated).
- • Lines beginning with blanks or containing no blanks at
- all are ignored and can be freely used for commenting.
-
- Additionally, be also aware that:
- • Abbreviations are case sensitive (eg. 'Abc' is different
- from 'abc' and 'aBc').
- • Redefinitions are ignored. Therefore, you will only be
- able to use the first definition with a particular abbr.
- • The size of abbreviation files is limited to
- approximately 32kByte after removing the comments (but
- before removing badly formatted or duplicate
- abbreviations).
-
- Telling MacDOS where the Abbreviation File is
- Set the global variable ABBREV to the full path which
- identifies the abbreviation file (without quoting it,
- because SET accepts all characters after the equal sign).
- If the abbreviation file is in a folder included in the
- PATH variable, you only need to set ABBREV to its filename.
-
- When MacDOS sees an assignment to ABBREV, it reads the
- file, stores the valid abbreviations in a block of dynamic
- memory, sorts them, and removes the duplicates.
-
- Expanding the Abbreviations
- To expand an abbreviation, type the abbr at the beginning
- of the command line or following a space. Then press shift-
- tab. MacDOS then replaces abbr with the corresponding this.
- If MacDOS does not find any matching abbr, it just ignores
- your request.
-
- If you type only some initial characters of abbr, MacDOS
- can still perform the replacement as long as it finds a
- single match in the abbreviation file.
-
- If MacDOS finds more than one matching abbreviation, it
- lists them all and re-prompts you. MacDOS also
- automatically extends your partial abbreviation if
- possible.
-
- Example
- In the file "1:\aFold\abbrev file" you stored the following
- lines:
-
- rain Rainbow Hill
- This line begins with a space. Therefore, it is a comment.
- The following line is empty. Still commenting...
-
- aaaa Silly abbreviation
- aaBc Ditto
-
- To activate the abbreviations, type the command:
-
- prompt>set abbrev=1:\aFold\abbrev file
-
- To see the active abbreviations, type a shift-tab
- immediately after the MacDOS prompt. You will see:
-
- aaBc "Ditto"
- aaaa "Silly abbreviation"
- rain " Rainbow Hill"
-
- If you now type (either at the beginning of the command
- line or after a space) aaBc followed by a shift-tab, MacDOS
- will replace it with the string Ditto. The same will happen
- if you only type aaB. If you type aa, MacDOS will display
- the two lines with the abbreviations aaaa and aaBc.
-
- Finally, if you type a single 'a' before typing shift-tab,
- MacDOS will extend it to 'aa' before typing the list of
- matching abbreviations. That is, MacDOS will recognise that
- all the abbreviations that match 'a' also match 'aa' and
- will therefore append the second 'a' to your partial
- abbreviation.
-
- Safe Hacks
- This section explains a couple of simple changes that you
- can safely make to MacDOS with ResEdit.
-
- Starting Up
- You can remove the initial splash screen (sigh!) by
- deleting or renumbering the 'PICT' resource number 129 (or
- 130 for black & white).
-
- Shutting Down
- When you execute the commands RESTART and SHUTDOWN, MacDOS
- displays a little picture with a farewell message. You can
- replace the corresponding 'PICT' resource number 131 with a
- picture of your liking.
-
- More Help
- You can add help messages by inserting resources of type
- 'TEXT'. When you type "help subject", MacDOS looks for a
- 'TEXT' resource named subject. Therefore, you only need to
- add the necessary text resource and MacDOS will pick it up.
-
- When you type "help ?", MacDOS lists the names of all
- resources of type 'TEXT' beginning with 128 and stopping
- when it finds the first missing number. Therefore, if you
- want to have the help items in alphabetical order, you will
- have to insert your resource in the appropriate place by
- "shifting down" the following ones.
-
- If you want to get help on any file, you only need to add
- to that file a resource of type 'TEXT' named "help". You
- will then be able to type "help file name". It will work
- irrespective of the file type. This is possible because
- MacDOS, before returning the error message "No help
- available", looks for a file with the requested name and
- checks whether it contains a 'TEXT' resource named "help".
-
- Changing Fonts
- When displaying characters in 9 and 12 points, MacDOS uses
- a modified version of Monaco with redefined zeroes and
- capital 'i's. The bitmapped fonts are stored in two
- resources of type 'FONT'. You can replace them with
- different fonts, but MacDOS will only maintain proper
- formatting if they are monospaced.
-
-